package com.zdxlz.fcmp.common.mybatis.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description：IPSec模板配置表【IKE验证方法】枚举类
 * @Author： aman
 * @Date： 2025/2/8 10:50
 */
@Getter
@AllArgsConstructor
public enum IkeVerifyMethodEnum {
    IKE_PRESHAREKEY(1, "PreShareKey"),
    IKE_X509(2, "X509"),
    ;
    @EnumValue
    private final Integer code;
    private final String name;

    public static IkeVerifyMethodEnum getByCode(Integer code) {
        for (IkeVerifyMethodEnum ikeVerifyMethodEnum : IkeVerifyMethodEnum.values()) {
            if (ikeVerifyMethodEnum.getCode() == code) {
                return ikeVerifyMethodEnum;
            }
        }
        return null;
    }

    @JsonValue
    public int getCode() {
        return code;
    }
}
